import wiringpi as gpio

led = 0
dust = 65
gpio.wiringPiSetup()
gpio.pinMode(led, gpio.OUTPUT)
gpio.pcf8591Setup(dust, 0x48)

while True:
  gpio.digitalWrite(led, gpio.LOW)
  gpio.delayMicroseconds(280)
  v = gpio.analogRead(dust)
  print(v, (v/1024-0.0356)*120000*0.035)
  gpio.delayMicroseconds(40)
  gpio.digitalWrite(led, gpio.HIGH)
  gpio.delayMicroseconds(9680)
  gpio.delay(1000)


